cmake_minimum_required(VERSION 2.6)

PROJECT(SuperQuadric_vtk)

SET(CMAKE_DEBUG_POSTFIX "D")

FIND_PACKAGE(VTK REQUIRED)
IF(VTK_USE_FILE)
  INCLUDE(${VTK_USE_FILE})
ENDIF(VTK_USE_FILE)

FIND_PACKAGE(Qt4 REQUIRED)
IF(QT_USE_FILE)
  INCLUDE(${QT_USE_FILE})
ELSE(QT_USE_FILE)
  SET(QT_LIBRARIES   ${QT_QT_LIBRARY})
ENDIF(QT_USE_FILE)

# Use the include path and library for Qt.
INCLUDE_DIRECTORIES(
        ${QT_INCLUDE_DIR}
        ${CMAKE_CURRENT_BINARY_DIR}
        ${CMAKE_CURRENT_SOURCE_DIR}
)

SET ( UI_SRCS
  qtWin_SQ.ui
  qtOpenWizard.ui
)

SET(RCCS
# resources.qrc
)

# generate rules for building source files from the resources
QT4_ADD_RESOURCES(RCC_SRCS ${RCCS})

QT4_WRAP_UI(UI_SRCS_H ${UI_SRCS})
QT4_WRAP_CPP(MOC_SRCS qtWin_SQ.h vtkwidget.h)

SET (HRS
  vector.h
  matrix.h
  misc.h
  fdecl.h
  quaternion.h
  hybroid.h
  deformation.h
  qtWin_SQ.h
  vtkwidget.h
#  overlay.h
#  display.h
)

SET (SRCS ${HRS} ${MOC_SRCS} 
  main.cpp
  read-data.cpp
  store_data.cpp
  hybroid.cpp
  superquadric.cpp
  element.cpp
  deformation.cpp
  dynamics.cpp
  intersection.cpp
  forces.cpp
  qtWin_SQ.cpp
  vtkwidget.cpp
#  display.c
#  user.c
)

ADD_EXECUTABLE( SuperQuadric_vtk MACOSX_BUNDLE ${SRCS} ${UI_SRCS_H} ${RCC_SRCS})

TARGET_LINK_LIBRARIES( SuperQuadric_vtk
  QVTK
  ${QT_LIBRARIES}
  vtkRendering
  vtkGraphics
  vtkIO
  vtkCommon
  vtkVolumeRendering
  vtkWidgets
)
